﻿using System;
using Aeon.Emulator;

namespace Aeon.Configuration
{
    /// <summary>
    /// Contains information which may be useful during virtual device initialization.
    /// </summary>
    public sealed class CreateDeviceParameters
    {
        /// <summary>
        /// Initializes a new instance of the CreateDeviceParameters class.
        /// </summary>
        /// <param name="vm">The VirtualMachine instance to which the device will be added.</param>
        /// <param name="parentWindow">The top-level application window handle.</param>
        public CreateDeviceParameters(VirtualMachine vm, IntPtr parentWindow)
        {
            if(vm == null)
                throw new ArgumentNullException("vm");
            if(parentWindow == IntPtr.Zero)
                throw new ArgumentNullException("parentWindow");

            this.VirtualMachine = vm;
            this.WindowHandle = parentWindow;
        }

        /// <summary>
        /// Gets the VirtualMachine instance which will own the new device.
        /// </summary>
        public VirtualMachine VirtualMachine { get; private set; }
        /// <summary>
        /// Gets the top-level application window handle.
        /// </summary>
        public IntPtr WindowHandle { get; private set; }
    }
}
